<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>IBustKeymap</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<link rel="home" href="index.html" title="IBust Reference Manual">
<link rel="up" href="ch03.html" title="Input method engine">
<link rel="prev" href="ibust-ibustkeys.html" title="ibustkeys">
<link rel="next" href="ibust-ibustkeysyms-compat.html" title="ibustkeysyms-compat">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="ibust-ibustkeys.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch03.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">IBust Reference Manual</th>
<td><a accesskey="n" href="ibust-ibustkeysyms-compat.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#IBustKeymap.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#IBustKeymap.description" class="shortcut">Description</a>
                   | 
                  <a href="#IBustKeymap.object-hierarchy" class="shortcut">Object Hierarchy</a>
</td></tr>
</table>
<div class="refentry">
<a name="IBustKeymap"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="IBustKeymap.top_of_page"></a>IBustKeymap</span></h2>
<p>IBustKeymap — Keyboard mapping handling.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="IBustKeymap.stability-level"></a><h2>Stability Level</h2>
Stable, unless otherwise indicated
</div>
<div class="refsynopsisdiv">
<a name="IBustKeymap.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">struct              <a class="link" href="IBustKeymap.html#IBustKeymap-struct" title="struct IBustKeymap">IBustKeymap</a>;
struct              <a class="link" href="IBustKeymap.html#IBustKeymapClass" title="struct IBustKeymapClass">IBustKeymapClass</a>;
<a class="link" href="IBustKeymap.html" title="IBustKeymap"><span class="returnvalue">IBustKeymap</span></a> *        <a class="link" href="IBustKeymap.html#ibust-keymap-get" title="ibust_keymap_get ()">ibust_keymap_get</a>                     (<em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>);
<span class="returnvalue">guint</span>               <a class="link" href="IBustKeymap.html#ibust-keymap-lookup-keysym" title="ibust_keymap_lookup_keysym ()">ibust_keymap_lookup_keysym</a>           (<em class="parameter"><code><a class="link" href="IBustKeymap.html" title="IBustKeymap"><span class="type">IBustKeymap</span></a> *keymap</code></em>,
                                                         <em class="parameter"><code><span class="type">guint16</span> keycode</code></em>,
                                                         <em class="parameter"><code><span class="type">guint32</span> state</code></em>);
<a class="link" href="IBustKeymap.html" title="IBustKeymap"><span class="returnvalue">IBustKeymap</span></a> *        <a class="link" href="IBustKeymap.html#ibust-keymap-new" title="ibust_keymap_new ()">ibust_keymap_new</a>                     (<em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="IBustKeymap.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  GObject
   +----GInitiallyUnowned
         +----<a class="link" href="IBustObject.html" title="IBustObject">IBustObject</a>
               +----IBustKeymap
</pre>
</div>
<div class="refsect1">
<a name="IBustKeymap.description"></a><h2>Description</h2>
<p>
An IBustKeymap defines the mapping between keyboard scancodes and
keyboard symbols such as numbers, alphabets, and punctuation marks.
</p>
<p>
Some input methods assume certain keyboard layout
(such as Chewing and Wubi requires an US-QWERTY layout),
and expect key symbols to be arranged in that order.
These input methods should new an IBustKeymap
instance and define the keyboard layout.
Then <a class="link" href="IBustKeymap.html#ibust-keymap-lookup-keysym" title="ibust_keymap_lookup_keysym ()"><code class="function">ibust_keymap_lookup_keysym()</code></a> can
convert scancodes back to the key symbols.
</p>
<p>
<em class="parameter"><code>see_also</code></em>: <a class="link" href="IBustComponent.html" title="IBustComponent"><span class="type">IBustComponent</span></a>, <a class="link" href="IBustEngineDesc.html" title="IBustEngineDesc"><span class="type">IBustEngineDesc</span></a>
</p>
</div>
<div class="refsect1">
<a name="IBustKeymap.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="IBustKeymap-struct"></a><h3>struct IBustKeymap</h3>
<pre class="programlisting">struct IBustKeymap {
    gchar *name;
    guint keymap[256][7];
};
</pre>
<p>
A keymap object in IBust.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><span class="type">gchar</span> *<em class="structfield"><code><a name="IBustKeymap-struct.name"></a>name</code></em>;</span></p></td>
<td>The name of the keymap, such as 'us', 'jp'.</td>
</tr>
<tr>
<td><p><span class="term"><span class="type">guint</span> <em class="structfield"><code><a name="IBustKeymap-struct.keymap"></a>keymap</code></em>[256][7];</span></p></td>
<td>Keymap table. IME developers normally don have to touch this.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="IBustKeymapClass"></a><h3>struct IBustKeymapClass</h3>
<pre class="programlisting">struct IBustKeymapClass {
    IBustObjectClass parent;
};
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="ibust-keymap-get"></a><h3>ibust_keymap_get ()</h3>
<pre class="programlisting"><a class="link" href="IBustKeymap.html" title="IBustKeymap"><span class="returnvalue">IBustKeymap</span></a> *        ibust_keymap_get                     (<em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>);</pre>
<p>
Get an IBustKeymap associated with the giving name.
</p>
<p>
This function loads the keymap file specified in <em class="parameter"><code>name</code></em>
in the IBUST_DATA_DIR/keymaps directory.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td>The keymap file to be loaded, such as 'us', 'jp'.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>An IBustKeymap associated with the giving name; or NULL if failed.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="ibust-keymap-lookup-keysym"></a><h3>ibust_keymap_lookup_keysym ()</h3>
<pre class="programlisting"><span class="returnvalue">guint</span>               ibust_keymap_lookup_keysym           (<em class="parameter"><code><a class="link" href="IBustKeymap.html" title="IBustKeymap"><span class="type">IBustKeymap</span></a> *keymap</code></em>,
                                                         <em class="parameter"><code><span class="type">guint16</span> keycode</code></em>,
                                                         <em class="parameter"><code><span class="type">guint32</span> state</code></em>);</pre>
<p>
Convert the scancode to keysym, given the keymap.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>keymap</code></em> :</span></p></td>
<td>An IBustKeymap.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>keycode</code></em> :</span></p></td>
<td>A scancode to be converted.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td>
<td>Modifier flags(such as Ctrl, Shift).</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>Corresponding keysym.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="ibust-keymap-new"></a><h3>ibust_keymap_new ()</h3>
<pre class="programlisting"><a class="link" href="IBustKeymap.html" title="IBustKeymap"><span class="returnvalue">IBustKeymap</span></a> *        ibust_keymap_new                     (<em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">ibust_keymap_new</code> is deprecated and should not be used in newly-written code. This function has been deprecated and should
not be used in newly written code. Please use <a class="link" href="IBustKeymap.html#ibust-keymap-get" title="ibust_keymap_get ()"><code class="function">ibust_keymap_get()</code></a>.</p>
</div>
<p>
Get an IBustKeymap associated with the giving name.
</p>
<p>
This function loads the keymap file specified in <em class="parameter"><code>name</code></em>
in the IBUST_DATA_DIR/keymaps directory.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td>The keymap file to be loaded, such as 'us', 'jp'.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>An IBustKeymap associated with the giving name; or NULL if failed.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>